import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'

const app = createApp(App)

// 全局axios配置
// axios.defaults.baseURL = 'http://localhost:5000/api'
axios.defaults.baseURL = '/api'

axios.interceptors.response.use(
  response => response.data,
  error => {
    console.error('API Error:', error)
    return Promise.reject(error)
  }
)

app.use(router)
app.mount('#app')
